"use strict";
cc._RF.push(module, '31a31FMW0ZMHJ2VDXAJTWUB', 'ememyAcc');
// script/ememyAcc.js

"use strict";

cc.Class({
  "extends": cc.Component,
  properties: {},
  onLoad: function onLoad() {
    // 拿到父亲
    this.enemy = this.node.parent.getComponent('enemy');
  },
  // 碰撞回调
  onCollisionEnter: function onCollisionEnter(other, self) {
    if (other.size.width == 0 || other.size.height == 0) {
      return;
    }

    console.log('other', other);

    if (other.node._name === 'hero') {
      this.enemy.hurt();
    }
  },
  start: function start() {} // update (dt) {},

});

cc._RF.pop();